package oop第三章作业;
import java.util.Scanner;
public class Troch {
    private int  power;
    public void  on(int power){
        do {
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            power=power-1;
            System.out.println(power);
        }while(power>0);
        System.out.println("手机电量耗尽");
    }
    public void charing(int power){
        power=this.power;
        System.out.println(power);
    }
    public  void off(int power){
        do {
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            power=power+1;
            System.out.println(power);
        }while(power<100);
        System.out.println("手机电量耗尽");
    }
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        Troch troch=new Troch();
        System.out.println("请输入您的手电筒电量：");
        int s=input.nextInt();
        troch.on(s);
    }
}
